<#import "/analysis/function.ftl" as fn>
<@fn.header _title="出具报告统计">
<@fn.getStreet />
</@fn.header>
<body>
<@fn.position _value="当前位置 &gt;&gt; 核对业务统计 &gt; 出具报告统计" />
<div class="contentDiv">
  <div class="condition">
    <h2>统计条件</h2>
    <form id="listForm" method="post">
	    <table class="tableStyle">
	      <tr>
	        <td width="11%">受理时间段：</td>
	        <td width="22%"><input name="acceptStartTime" type="text" class="btnTxtDate" id="textfield" onClick="WdatePicker()" />
	          至
	          <input name="acceptEndTime" type="text" class="btnTxtDate" id="textfield13" onClick="WdatePicker()" />
	          </td>
	        <td width="10%">所属区县：</td>
	        <td width="24%"><select name="countiesRegionId" class="btnSelect" id="country" onchange="getStreet(this.value)">
	            <option value="">-- 请选择 --</option>
				<#if countryRegionList??>
					<#list countryRegionList as region>
					  <option value="${region.id}">${region.name}</option>
					</#list>
				</#if>
	          </select>
	          </td>
	        <td width="11%">所属街道：</td>
	        <td width="22%"><select name="streetRegionId" class="btnSelect" id="street">
	            <option value="">-- 请选择 --</option>
	          </select></td>
	      </tr>
	    </table>
	    <table class="buttonT">
	      <tr>
	        <td width="10%"><input type="submit" class="button" value="统 计" /></td>
	      </tr>
	    </table>
    </form>
  </div>
  <div class="reasult">
    <h2>统计结果</h2>
    <form id="exportExcel" action="${base}/checkBusinessStat/exportExcel" method="post">
    <table class="gridStyle">
      <tr>
        <th>区县</th>
        <th>街道</th>
        <th>出具报告总数</th>
        <th>超收入报告数</th>
        <th>超财产报告数 </th>
        <th>收入和财产均超报告数 </th>
      </tr>
        <#assign reportSumTotal=0 />
        <#assign superIncomReportNumTotal=0 />
        <#assign superPropertyNumTotal=0 />
        <#assign superBothNumTotal=0 />
      <#list resultList as data>
        <#assign reportSumTotal=reportSumTotal+ data.streetReportDataList[0].reportSum />
        <#assign superIncomReportNumTotal=superIncomReportNumTotal+ data.streetReportDataList[0].superIncomReportNum />
        <#assign superPropertyNumTotal=superPropertyNumTotal+ data.streetReportDataList[0].superPropertyNum />
        <#assign superBothNumTotal=superBothNumTotal+ data.streetReportDataList[0].superBothNum />
      <tr>
        <td<#if (data.streetReportDataList?size>1)> rowspan="${data.streetReportDataList?size}"</#if>>${data.countryRegionName}</td>
        <td>${data.streetReportDataList[0].streetRegionName}</td>
        <td>${data.streetReportDataList[0].reportSum}</td>
        <td>${data.streetReportDataList[0].superIncomReportNum}</td>
        <td>${data.streetReportDataList[0].superPropertyNum}</td>
        <td>${data.streetReportDataList[0].superBothNum}</td>
      </tr>
	      <#if (data.streetReportDataList?size>1)>
		      <#list data.streetReportDataList[1..] as _data>
		        <#assign reportSumTotal=reportSumTotal+ _data.reportSum />
		        <#assign superIncomReportNumTotal=superIncomReportNumTotal+ _data.superIncomReportNum />
		        <#assign superPropertyNumTotal=superPropertyNumTotal+ _data.superPropertyNum />
		        <#assign superBothNumTotal=superBothNumTotal+ _data.superBothNum />
			      <tr>
			        <td>${_data.streetRegionName}</td>
			        <td>${_data.reportSum}</td>
			        <td>${_data.superIncomReportNum}</td>
			        <td>${_data.superPropertyNum}</td>
			        <td>${_data.superBothNum}</td>
			      </tr>
		      </#list>
	      </#if>
	  </#list>
      <tr>
        <td colspan="2">合计</td>
        <td><input type="hidden" name="reportSumTotal" value='${reportSumTotal}'/>${reportSumTotal}</td>
        <td><input type="hidden" name="superIncomReportNumTotal" value='${superIncomReportNumTotal}'/>${superIncomReportNumTotal}</td>
        <td><input type="hidden" name="superPropertyNumTotal" value='${superPropertyNumTotal}'/>${superPropertyNumTotal}</td>
        <td><input type="hidden" name="superBothNumTotal" value='${superBothNumTotal}'/>${superBothNumTotal}</td>
      </tr>
    </table>
	<table class="buttonT">
      <tr>
        <td width="10%"><input type="submit" class="button" value="导出Excel" /></td>
      </tr>
    </table>
    </form>
  </div>
  <div class="explain">
    <h3>说明：</h3>
    <p>1. 未选择统计条件的情况下，默认登陆用户权限下“开始至今”所有数据的统计。</p>
    <p>2. 统计表可下载（excel)、打印。</p>
    <p>3. 超收入=只超收入不超财产，超财产=只超财产不超收入。</p>
  </div>
</div>
</body>
</html>
